import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
export function loadDepartmentDetail(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}
// 修改详情
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
